package view;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.Random;

import javax.swing.JPanel;
import javax.swing.border.MatteBorder;

@SuppressWarnings("serial")
public class QuickViewGraphs extends JPanel {

	/**
	 * Create the panel.
	 */
	public QuickViewGraphs() {
		setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

	}

	@Override
	protected void paintComponent(Graphics gr) {
		Graphics2D g = (Graphics2D) gr;
				
		Random rnd = new Random();
		
		int previousY = 0;
		int factor = 4;
		
		for (int x = 0; x < getWidth()/factor; x++) {
			int y = rnd.nextInt(getHeight());
			
			g.drawLine((x-1)*factor, previousY, x*factor, y);
			
			previousY = y;
		}
	}
}
